Gracefully handle errors from before() and after().#45
Open
LukeShu wants to merge 2 commits intobmizerany:masterfrom
Open
Gracefully handle errors from before() and after().#45LukeShu wants to merge 2 commits intobmizerany:masterfrom
LukeShu wants to merge 2 commits intobmizerany:masterfrom
Conversation
See the comments for a fuller explanation of the changes. This should obsolete bmizerany#23 (though the test cases from it should still be merged). This should fix bmizerany#29 . This should fix bmizerany#44 .
Fix multiple invocation of the `before` function and `before` tracing
1. The `before` function had been called twice, once with proper tracing and error
output redirection and once directly. This is fixed now.
2. The result output was moved out of the inner subshell. This is necessary
because: in case the `before` function has an error, roundup's error trap is
triggered and the inner subshell is left. Still, we need a proper result ouput.
3. A test case with a broken `before` function was added which gives
the following output:
roundup before trace
it_works: [FAIL]
+ false
exit code 1
for the following before function:
before () {
false
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is written to fix issue #44 , though it also fixes issue #29 , and subsumes PR #23.